package com.hrm.util;


public class MyColumn {
	private String colname;
	private String coltype;
	private int colsize;
	private boolean isNullAble;
	private String javaType;
	private String javaProperty;
	public MyColumn() {
		super();
	}
	public String getJavaProperty() {
		return javaProperty;
	}
	public void setJavaProperty(String javaProperty) {
		this.javaProperty = javaProperty;
	}
	public String getColname() {
		return colname;
	}
	public void setColname(String colname) {
		this.colname = colname;
	}
	public String getColtype() {
		return coltype;
	}
	public void setColtype(String coltype) {
		this.coltype = coltype;
	}
	public MyColumn(String colname, String coltype, int colsize,
			boolean isNullAble) {
		super();
		this.colname = colname;
		this.javaProperty=GeneratorUtils.Column2Property(colname);
		this.coltype = coltype;
		this.colsize = colsize;
		this.isNullAble = isNullAble;
		if(this.coltype.equals("INT")&&this.colsize>10){
			this.javaType="long";
		}else if((this.coltype.equals("INT")&&this.colsize<=10)||this.coltype.equals("SMALLINT")){
			this.javaType="int";
		}else if((this.coltype.equals("SMALLINT")&&this.colsize<=10)||this.coltype.equals("SMALLINT")){
			this.javaType="int";
		}else if((this.coltype.equals("TINYINT")&&this.colsize<=10)||this.coltype.equals("SMALLINT")){
			this.javaType="int";
		}else if(this.coltype.equals("BIGINT")){
			this.javaType="long";
		}else if(this.coltype.equals("VARCHAR")){
			this.javaType="String";
		}else if(this.coltype.equals("CHAR")){
			this.javaType="String";
		}else if(this.coltype.equals("DOUBLE")){
			this.javaType="double";
		}else if(this.coltype.equals("DATE")){
			this.javaType="java.util.Date";
		}else if(this.coltype.equals("TIMESTAMP")){
			this.javaType="java.util.Date";
		}else if(this.coltype.equals("BLOB")){
			this.javaType="byte[]";
		}
	}
	public int getColsize() {
		return colsize;
	}
	public void setColsize(int colsize) {
		this.colsize = colsize;
	}
	public boolean isNullAble() {
		return isNullAble;
	}
	public void setNullAble(boolean isNullAble) {
		this.isNullAble = isNullAble;
	}
	public String getJavaType() {
		return javaType;
	}
	public void setJavaType(String javaType) {
		this.javaType = javaType;
	}
	
}
